package com.yupi.oj.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.oj.model.dto.questionSubmitLog.QuestionSubmitLogAddRequest;
import com.yupi.oj.model.dto.questionSubmitLog.QuestionSubmitLogSearchRequest;
import com.yupi.oj.model.entity.QuestionSubmitLog;
import com.yupi.oj.model.vo.QuestionSubmitLogVO;


import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author yanghaifeng
 * @description 针对表【questionSubmitLog_submit_log(做题提交记录表)】的数据库操作Service
 * @createDate 2024-04-11 15:36:58
 */
public interface QuestionSubmitLogService extends IService<QuestionSubmitLog> {

    /**
     * 创建做题提交记录
     *
     * @param questionSubmitLogAddRequest 请求数据
     * @param request
     * @return 创建做题提交记录 Id
     */
    Long add(QuestionSubmitLogAddRequest questionSubmitLogAddRequest, HttpServletRequest request);

    /**
     * 删除做题提交记录
     *
     * @param id      做题提交记录 Id
     * @param request
     * @return 是否删除成功
     */
    Boolean delete(Long id, HttpServletRequest request);


    /**
     * 查询做题提交记录
     *
     * @param id 做题提交记录 Id
     * @return 做题提交记录信息
     */
    QuestionSubmitLogVO queryById(Long id);


    /**
     * 列表查询
     *
     * @param questionSubmitLogSearchRequest 查询参数
     * @return 列表结果
     */
    List<QuestionSubmitLogVO> queryList(QuestionSubmitLogSearchRequest questionSubmitLogSearchRequest);

    /**
     * 根据题目 Id 查询做题记录列表
     *
     * @param questionId 做题id
     * @return 做题记录列表
     */
    List<QuestionSubmitLogVO> queryListByQuestionId(Long questionId);

}
